package com.pwrd.sframe.support.util;

/**
 * @Auther syc.
 * @Date 2017/1/10 15:03.
 */
public class Utils {

    /**
     * 拼接字符串，将变量赋值到字符串中的{}里
     * @param s
     * @param obj
     * @return
     */
    public static String mergeStr(String s, Object... obj) {
        String[] strs = s.split("\\{}");
        int length = Math.min(strs.length, obj.length);
        StringBuffer sbuffer = new StringBuffer();
        for(int i=0; i<length; i++) {
            sbuffer.append( strs[i] + obj[i]);
        }

        return sbuffer.toString();
    }
}
